@set PACKAGE_PATH=gitee.com\nggs\microservice
@set WORK_DIR=%GOPATH%\src\%PACKAGE_PATH%


@IF "%1" == "" call :install & cd %WORK_DIR% & goto :exit

@IF "%1" == "msctl" call :msctl & cd %WORK_DIR% & goto :exit

@IF "%1" == "mod-tidy" call :mod-tidy & cd %WORK_DIR% & goto :exit

@IF "%1" == "cluster-protos" call :cluster-protos & cd %WORK_DIR% & goto :exit

@echo unsupported operate [%1]

@goto :exit


:install
@echo install all begin
@call :msctl
@echo install all end
@goto :exit


:msctl
@echo install [msctl] begin
go install %PACKAGE_PATH%\tools\msctl
@echo install [msctl] end
@goto :exit


:mod-tidy
@echo [mod-tidy] begin
go mod tidy
@echo [mod-tidy] end
@goto :exit


:cluster-protos
@echo [cluster-protos] begin
cd cluster
@call gen.bat
@echo [cluster-protos] end
@goto :exit


:exit
